package com.chushouya.manager.constants;


import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

/**
 * 账户类型
 */
public enum AccountUserTypeEnum implements IEnum<Integer> {
    merchant(0, "回收商"),
    store(1, "门店");


    private Integer value;

    private String desc;

    AccountUserTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (AccountUserTypeEnum thisEnum : AccountUserTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
